package com.baidu.health.controller;

import com.baidu.health.pojo.Cart;
import com.baidu.health.pojo.TbOrderItem;
import com.baidu.health.service.CartService;
import com.baidu.health.util.Result;
import com.baidu.health.util.ResultResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by IntelliJ IDEA.
 * User: 孙新超
 *
 * @author 孙新超
 * @version 1.0
 * @date To change this template use File | Settings | File Templates.
 * @date
 */
@Api(tags = "购物车")
@RestController
@RequestMapping("cart")
public class CartController {
    @Autowired
    HttpServletRequest request;

    @Autowired
    CartService cartService;
    /**
     *
     * @param goodsId
     * @return
     */
    @ApiOperation("添加购物车")
    @PostMapping("addToCart/{goodsId}")
    public ResultResponse addToCart(@PathVariable Integer goodsId, TbOrderItem tbOrderItem){
        return cartService.addToCart(goodsId);
    }



}
